﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using VkClientIM.Logic;
using Vkontakte.Api.Operations;

namespace VkClientIM.Windows
{
	/// <summary>
	/// Interaction logic for SendStandaloneMessage.xaml
	/// </summary>
	public partial class SendStandaloneMessage : Window
	{
		private long _userID;

		public SendStandaloneMessage()
		{
			InitializeComponent();
		}


		public void LoadProfile(Profile p)
		{
			_userID = p.UserID;
			firstName.Text = p.FirstName;
			lastName.Text = p.LastName;
			nickName.Text = p.NickName;
			activity.Text = p.Activity;
		}

		private void Button_Click(object sender, RoutedEventArgs e)
		{
			MessagesSend q=new MessagesSend();
			q.MessageType = MessageType.Normal;
			q.UserID = _userID;
			if (messageHeader.Text!="")
			{
				q.Title = messageHeader.Text;
			}
			q.Message = messageBody.Text;
			App.Current.ApiClient.ExecuteHighPriorityQuerry(q);
			this.Close();
			//
		}
	}
}
